﻿
CREATE proc [dbo].[proc_Notice_GetList_Count]
(
	@CompanyId int,
	@Title nvarchar(200)
)
as	
	Begin
		
		select
			Count(N.Id)
		From Notice N 
		Where (@CompanyId=0 Or (select companyid from aspnet_Users where username=N.UpName)=@CompanyId) And (@Title is null Or N.Title like '%'+ @Title +'%') 
	
	End
	RETURN